/*  
#include <iostream>
#include <assert.h> // assert(true); -> silence  assert(false); -> print line no and stop

int max(int x, int y){
  if(x < y) 
    return y;
  else 
    return x;
}


static void __assert_max_two_value(int x, int y, int expect){
    int result = max(x, y);    //a < b
    assert(result == expect);
}
void test_max_two_value(){
  __assert_max_two_value(1, 10, 10);
  __assert_max_two_value(10, 1, 10);
  __assert_max_two_value(3, 2, 3);
  __assert_max_two_value(394, 34, 394);
  __assert_max_two_value(2, 2, 2);
}





bool max(const int * array, const int len, int * result){
  if(array == nullptr || len <= 0 || result == nullptr) return false;

  *result = array[0];
  for(int i = 1; i < len; ++i){
    if(*result < array[i]){
      *result = array[i];
    }
  }
  return true;
}

static void __assert_max_array(int * array, int len, 
void test_max_array(){
  {
    int array[] = {};
    int result = 0;
    int ok = max(array, sizeof(array)/sizeof(int), &result);
    assert(ok == false);
  }
  {
    int array[] = {-1, 0};
    int ok = max(array, sizeof(array)/sizeof(int), nullptr);
    assert(ok == false);
  }

  { // interface 
    int array[] = {-1};
    int result = 0;
    int ok = max(array, sizeof(array)/sizeof(int), &result);
    assert(ok == true && result == -1);
  }
  
  { // interface 
    int ok = max(nullptr, 0, nullptr);
    assert(ok == false);
  }

  { // interface 
    int array[] = {0};
    int ok = max(array, -1, nullptr);
    assert(ok == false);
  }

  {
    int array[] = {10, 1};
    int result = max(array[0], array[1]); // call max(x, y)
    assert(result == 10);

  }
  {
    int array[] = {10, 1};
    int result = 0;
    int ok = max(array, sizeof(array)/sizeof(int), &result);
    assert(ok && result == 10);
  }

  { // interface 
    int array[] = {10, 1};
    int result = 0;
    int ok = max(array, sizeof(array)/sizeof(int), &result);
    assert(ok && result == 10);
  }

  { // interface 
    int array[] = {0, 1, 2, 3 , 4};
    int result = 0;
    int ok = max(array, sizeof(array)/sizeof(int), &result);
    assert(ok && result == 4);
  }

  { // interface 
    int array[] = {0};
    int result = 0;
    int ok = max(array, sizeof(array)/sizeof(int), &result);
    assert(ok && result == 0);
  }
}

int main(){
  test_max_two_value();
  test_max_array();
  return 0;
}
*/
